from django.urls import path, re_path
# from rest_framework_jwt.views import obtain_jwt_token
from apps.user import views

urlpatterns = [
    # path('login/', obtain_jwt_token),
    path('login/', views.LoginView.as_view()),
    path('register/', views.RegisterView.as_view()),
    path('list/', views.UserViewSet.as_view({'get': 'list'})),
    path('<int:pk>/', views.UserViewSet.as_view({'get': 'retrieve', 'put': 'update'})),
    path('<int:pk>/password/', views.UserPwdViewSet.as_view({'put': 'update'})),
    re_path(r'^(?P<username>\w{2,20})/count/$', views.UsernameIsExistedView.as_view()),
    # re_path(r'^(?P<email>[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+)/count/$',
    #         views.EmailIsExistedView.as_view()),
]
